<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //const let 更好， 不会污染window
        console.log(a);//变量的定义提升，值并没有提升 提升到全局作用域的顶部去
        var a = '11';//不用var
        //console.log(pizza);// let const 不支持变量的提升
        const pizza = 'zz';
        fn();
        function fn() {//函数表达式
            console.log('fn'); //函数也会变量提升 值也会提升
        }   
        
    </script>
</body>
</html>